package net.tv90.volunteerserveradmin.model.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.tv90.volunteerserveradmin.model.domain.Student;
import net.tv90.volunteerserveradmin.model.domain.User;

import java.io.Serializable;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StudentVO implements Serializable {
    private String studentNumber;
    private String name;
    private String gender;
    private String major;
    private Date dateOfBirth; // 出生日期
    private String idCardNumber;
    private Integer enrollmentYear;
    private String userName;
    private String email;
    private Long studentId;
    private String studentClass;
    private String address; // 地址

    public StudentVO(Student student, User user) {
        this.studentId = student.getId();
        this.studentNumber = student.getStudentNumber();
        this.name = student.getName();
        this.gender = student.getGender();
        this.major = student.getMajor();
        this.dateOfBirth = student.getDateOfBirth();
        this.enrollmentYear = student.getEnrollmentYear();
        this.idCardNumber = student.getIdCardNumber();
        this.address = student.getAddress();
        this.studentClass = student.getStudentClass();
        this.userName = user.getUsername();
        this.email = user.getEmail();
    }
}
